home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume11 / jove.pch / part02 < prev    next >
Encoding:
Internet Message Format  |  1987-09-15  |  46.1 KB

  1. Subject:  v11i046:  Jove upgrade kit, Part02/04
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rs@uunet.UU.NET
  5.  
  6. Submitted-by: Jonathan Payne  <jpayne@cs.rochester.edu>
  7. Posting-number: Volume 11, Issue 46
  8. Archive-name: jove.pch/Part02
  9.  
  10. #! /bin/sh
  11. # This is a shell archive.  Remove anything before this line, then unpack
  12. # it by saving it into a file and typing "sh file".  To overwrite existing
  13. # files, type "sh file -c".  You can also feed this as standard input via
  14. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  15. # will see the following message at the end:
  16. #        "End of archive 2 (of 4)."
  17. # Contents:  jove.pch.2
  18. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  19. if test -f 'jove.pch.2' -a "${1}" != "-c" ; then 
  20.   echo shar: Will not clobber existing file \"'jove.pch.2'\"
  21. else
  22. echo shar: Extracting \"'jove.pch.2'\" \(43705 characters\)
  23. sed "s/^X//" >'jove.pch.2' <<'END_OF_FILE'
  24. Xdiff -c ojove/fp.c jove/fp.c
  25. X*** ojove/fp.c    Thu Jul 16 09:14:23 1987
  26. X--- jove/fp.c    Fri Jun 12 10:30:44 1987
  27. X***************
  28. X*** 7,12 ****
  29. X--- 7,13 ----
  30. X  
  31. X  #include "jove.h"
  32. X  #include "io.h"
  33. X+ #include "ctype.h"
  34. X  #include "termcap.h"
  35. X  #include <sys/stat.h>
  36. X  #include <sys/file.h>
  37. X***************
  38. X*** 14,22 ****
  39. X  
  40. X  #define MAXFILES    20    /* good enough for my purposes */
  41. X  
  42. X! static File    _openfiles[MAXFILES] = {0};
  43. X  
  44. X! static File *
  45. X  f_alloc(name, flags, fd, buffer, buf_size)
  46. X  char    *name,
  47. X      *buffer;
  48. X--- 15,23 ----
  49. X  
  50. X  #define MAXFILES    20    /* good enough for my purposes */
  51. X  
  52. X! private File    _openfiles[MAXFILES] = {0};
  53. X  
  54. X! private File *
  55. X  f_alloc(name, flags, fd, buffer, buf_size)
  56. X  char    *name,
  57. X      *buffer;
  58. X***************
  59. X*** 106,111 ****
  60. X--- 107,114 ----
  61. X          return EOF;
  62. X      fp->f_ptr = fp->f_base;
  63. X      fp->f_cnt = read(fp->f_fd, fp->f_base, fp->f_bufsize);
  64. X+     while (fp->f_cnt == -1 && errno == EINTR)
  65. X+         fp->f_cnt = read(fp->f_fd, fp->f_base, fp->f_bufsize);
  66. X      if (fp->f_cnt == -1) {
  67. X          printf("[Read error %d]", errno);
  68. X          fp->f_flags |= F_ERR;
  69. X***************
  70. X*** 147,152 ****
  71. X--- 150,166 ----
  72. X      _flush(EOF, fp);
  73. X  }
  74. X  
  75. X+ f_seek(fp, offset)
  76. X+ register File    *fp;
  77. X+ off_t    offset;
  78. X+ {
  79. X+     if (fp->f_flags & F_WRITE)
  80. X+         flush(fp);
  81. X+     fp->f_cnt = 0;        /* next read will filbuf(), next write
  82. X+                    will flush() with no bad effects */
  83. X+     lseek(fp->f_fd, (long) offset, L_SET);
  84. X+ }
  85. X+ 
  86. X  _flush(c, fp)
  87. X  register File    *fp;
  88. X  {
  89. X***************
  90. X*** 182,188 ****
  91. X          return EOF;
  92. X      while (((c = getc(fp)) != EOF) && (c != '\n')) {
  93. X          if (c == NULL)
  94. X!             continue;    /* sorry we don't read nulls */
  95. X          if (cp >= endp) {
  96. X              add_mess(" [Line too long]");
  97. X              rbell();
  98. X--- 196,202 ----
  99. X          return EOF;
  100. X      while (((c = getc(fp)) != EOF) && (c != '\n')) {
  101. X          if (c == NULL)
  102. X!             break;        /* sorry we don't read nulls */
  103. X          if (cp >= endp) {
  104. X              add_mess(" [Line too long]");
  105. X              rbell();
  106. X***************
  107. X*** 201,215 ****
  108. X      return NIL;    /* this means okay */
  109. X  }
  110. X  
  111. X  /* Deals with output to the terminal, setting up the amount of characters
  112. X     to be buffered depending on the output baud rate.  Why it's in a 
  113. X     separate file I don't know ... */
  114. X  
  115. X! static char    one_buf;
  116. X  
  117. X  int    BufSize = 1;
  118. X  
  119. X! static File    _stdout = {1, 1, 1, F_WRITE, &one_buf, &one_buf};
  120. X  File    *stdout = &_stdout;
  121. X  
  122. X  /* put a string with padding */
  123. X--- 215,264 ----
  124. X      return NIL;    /* this means okay */
  125. X  }
  126. X  
  127. X+ /* skip to beginning of next line, i.e., next read returns first
  128. X+    character of new line */
  129. X+ f_toNL(fp)
  130. X+ register File    *fp;
  131. X+ {
  132. X+     register int    c;
  133. X+ 
  134. X+     if (fp->f_flags & F_EOF)
  135. X+         return;
  136. X+     while (((c = getc(fp)) != EOF) && (c != '\n'))
  137. X+         ;
  138. X+     if (c == EOF)
  139. X+         fp->f_flags |= F_EOF;
  140. X+ }
  141. X+ 
  142. X+ f_readn(fp, addr, n)
  143. X+ register File    *fp;
  144. X+ register char    *addr;
  145. X+ register int    n;
  146. X+ {
  147. X+     while (--n >= 0)
  148. X+         *addr++ = getc(fp);
  149. X+ }
  150. X+ 
  151. X+ f_getint(fp)
  152. X+ File    *fp;
  153. X+ {
  154. X+     int    n = 0,
  155. X+         c;
  156. X+ 
  157. X+     while (isdigit(c = getc(fp)))
  158. X+         n = (n * 10) + c;
  159. X+     return n;
  160. X+ }
  161. X+ 
  162. X  /* Deals with output to the terminal, setting up the amount of characters
  163. X     to be buffered depending on the output baud rate.  Why it's in a 
  164. X     separate file I don't know ... */
  165. X  
  166. X! private char    one_buf;
  167. X  
  168. X  int    BufSize = 1;
  169. X  
  170. X! private File    _stdout = {1, 1, 1, F_WRITE, &one_buf, &one_buf};
  171. X  File    *stdout = &_stdout;
  172. X  
  173. X  /* put a string with padding */
  174. Xdiff -c ojove/funcdefs.c jove/funcdefs.c
  175. X*** ojove/funcdefs.c    Thu Jul 16 09:14:24 1987
  176. X--- jove/funcdefs.c    Fri Jun 12 12:25:57 1987
  177. X***************
  178. X*** 6,11 ****
  179. X--- 6,12 ----
  180. X   ************************************************************************/
  181. X  
  182. X  #include "jove.h"
  183. X+ #include "ctype.h"
  184. X  
  185. X  #ifndef TXT_TO_C
  186. X  extern int
  187. X***************
  188. X*** 97,103 ****
  189. X      ForChar(),
  190. X      FSexpr(),
  191. X      ForWord(),
  192. X!     FourTime(),
  193. X      GoLine(),
  194. X      GrowWindow(),
  195. X      IncFSearch(),
  196. X--- 98,104 ----
  197. X      ForChar(),
  198. X      FSexpr(),
  199. X      ForWord(),
  200. X!     TimesFour(),
  201. X      GoLine(),
  202. X      GrowWindow(),
  203. X      IncFSearch(),
  204. X***************
  205. X*** 167,172 ****
  206. X--- 168,174 ----
  207. X      SpelBuffer(),
  208. X  #endif
  209. X      SplitWind(),
  210. X+     GotoWind(),
  211. X      Remember(),
  212. X      Forget(),
  213. X      StrLength(),
  214. X***************
  215. X*** 354,363 ****
  216. X--- 356,367 ----
  217. X      FUNCTION, "forward-sentence", WIRED_CMD(Eos),
  218. X      FUNCTION, "forward-word", WIRED_CMD(ForWord),
  219. X      DefMajor(FUNDAMENTAL), "fundamental-mode", 0,
  220. X+     FUNCTION, "gather-numeric-argument", WIRED_CMD(TimesFour),
  221. X  #ifdef LISP
  222. X      FUNCTION, "grind-s-expr", WIRED_CMD(GSexpr),
  223. X  #endif
  224. X      FUNCTION, "goto-line", WIRED_CMD(GoLine),
  225. X+     FUNCTION, "goto-window-with-buffer", WIRED_CMD(GotoWind),
  226. X      FUNCTION, "grow-window", WIRED_CMD(GrowWindow),
  227. X      FUNCTION, "handle-tab", WIRED_CMD(Tab),
  228. X      FUNCTION, "i-search-forward", WIRED_CMD(IncFSearch),
  229. X***************
  230. X*** 432,438 ****
  231. X      FUNCTION, "pushd", WIRED_CMD(Pushd),
  232. X      FUNCTION, "pwd", WIRED_CMD(prCWD),
  233. X  #endif
  234. X-     FUNCTION, "quadruple-numeric-argument", WIRED_CMD(FourTime),
  235. X      FUNCTION, "query-replace-string", WIRED_CMD(QRepSearch),
  236. X  #ifdef IPROCS
  237. X      FUNCTION, "quit-process", WIRED_CMD(ProcQuit),
  238. X--- 436,441 ----
  239. X***************
  240. X*** 520,530 ****
  241. X          struct cmd    *which;
  242. X          int    cmdlen,
  243. X              found = 0;
  244. X!         static struct cmd    *cmdhash[1 + 26];
  245. X          static int    beenhere = NO;
  246. X  
  247. X  /* special case for prefix commands--only upper case ones */
  248. X! #define hash(c)    ((c == 'P') ? 0 : 1 + (c - 'a'))
  249. X  
  250. X          /* initialize the hash table */
  251. X          if (beenhere == NO) {
  252. X--- 523,533 ----
  253. X          struct cmd    *which;
  254. X          int    cmdlen,
  255. X              found = 0;
  256. X!         static struct cmd    *cmdhash[26];
  257. X          static int    beenhere = NO;
  258. X  
  259. X  /* special case for prefix commands--only upper case ones */
  260. X! #define hash(c)    (c - 'a')
  261. X  
  262. X          /* initialize the hash table */
  263. X          if (beenhere == NO) {
  264. X***************
  265. X*** 539,546 ****
  266. X          }
  267. X  
  268. X          /* gather the cmd name */
  269. X!         while (((c = getch()) != EOF) && !index(" \t\r\n", c))
  270. X              *cp++ = c;
  271. X          if (c == EOF)
  272. X              return 0;
  273. X          *cp = '\0';
  274. X--- 542,552 ----
  275. X          }
  276. X  
  277. X          /* gather the cmd name */
  278. X!         while (((c = getch()) != EOF) && !index(" \t\r\n", c)) {
  279. X!             if (isupper(c))
  280. X!                 c = tolower(c);
  281. X              *cp++ = c;
  282. X+         }
  283. X          if (c == EOF)
  284. X              return 0;
  285. X          *cp = '\0';
  286. X***************
  287. X*** 549,555 ****
  288. X              return 0;
  289. X  
  290. X          /* look it up (in the reduced search space) */
  291. X!         for (cmd = cmdhash[hash(cmdbuf[0])]; cmd->Name[0] == cmdbuf[0]; cmd++) {
  292. X              if (strncmp(cmd->Name, cmdbuf, cmdlen) == 0) {
  293. X                  if (strcmp(cmd->Name, cmdbuf) == 0)
  294. X                      return (data_obj *) cmd;
  295. X--- 555,562 ----
  296. X              return 0;
  297. X  
  298. X          /* look it up (in the reduced search space) */
  299. X!         if (islower(cmdbuf[0]))
  300. X!             for (cmd = cmdhash[hash(cmdbuf[0])]; cmd != 0 && cmd->Name[0] == cmdbuf[0]; cmd++) {
  301. X              if (strncmp(cmd->Name, cmdbuf, cmdlen) == 0) {
  302. X                  if (strcmp(cmd->Name, cmdbuf) == 0)
  303. X                      return (data_obj *) cmd;
  304. X***************
  305. X*** 556,562 ****
  306. X                  found++;
  307. X                  which = cmd;
  308. X              }
  309. X!         }
  310. X          if (found > 1)
  311. X              complain("[\"%s\" ambiguous]", cmdbuf);
  312. X          else if (found == 0)
  313. X--- 563,569 ----
  314. X                  found++;
  315. X                  which = cmd;
  316. X              }
  317. X!             }
  318. X          if (found > 1)
  319. X              complain("[\"%s\" ambiguous]", cmdbuf);
  320. X          else if (found == 0)
  321. X***************
  322. X*** 565,581 ****
  323. X              return (data_obj *) which;
  324. X      } else {
  325. X          static char    *strings[(sizeof commands) / sizeof (commands[0])];
  326. X!         static int    beenhere = 0;
  327. X          register int    com;
  328. X  
  329. X!         if (beenhere == 0) {
  330. X              register char    **strs = strings;
  331. X!             register struct cmd    *c = commands;
  332. X  
  333. X!             beenhere = 1;
  334. X!             for (; c->Name; c++)
  335. X                  *strs++ = c->Name;
  336. X              *strs = 0;
  337. X          }
  338. X  
  339. X          if ((com = complete(strings, prompt, CASEIND)) < 0)
  340. X--- 572,588 ----
  341. X              return (data_obj *) which;
  342. X      } else {
  343. X          static char    *strings[(sizeof commands) / sizeof (commands[0])];
  344. X!         static int    beenhere = NO;
  345. X          register int    com;
  346. X  
  347. X!         if (beenhere == NO) {
  348. X              register char    **strs = strings;
  349. X!             register struct cmd    *c;
  350. X  
  351. X!             for (c = commands; c->Name != 0; c++)
  352. X                  *strs++ = c->Name;
  353. X              *strs = 0;
  354. X+             beenhere = YES;
  355. X          }
  356. X  
  357. X          if ((com = complete(strings, prompt, CASEIND)) < 0)
  358. Xdiff -c ojove/insert.c jove/insert.c
  359. X*** ojove/insert.c    Thu Jul 16 09:14:25 1987
  360. X--- jove/insert.c    Fri Jul 10 09:25:50 1987
  361. X***************
  362. X*** 96,108 ****
  363. X          incrmt = (tabstop - (dotcol % tabstop));
  364. X          if (dotcol + incrmt > goal)
  365. X              break;
  366. X!         Insert('\t');
  367. X          dotcol += incrmt;
  368. X      }
  369. X      if (dotcol != goal)
  370. X!         DoTimes(Insert(' '), (goal - dotcol));
  371. X!     exp_p = NO;
  372. X!     exp = 1;
  373. X  }
  374. X  
  375. X  SelfInsert()
  376. X--- 96,106 ----
  377. X          incrmt = (tabstop - (dotcol % tabstop));
  378. X          if (dotcol + incrmt > goal)
  379. X              break;
  380. X!         insert_c('\t', 1);
  381. X          dotcol += incrmt;
  382. X      }
  383. X      if (dotcol != goal)
  384. X!         insert_c(' ', (goal - dotcol));
  385. X  }
  386. X  
  387. X  SelfInsert()
  388. X***************
  389. X*** 116,132 ****
  390. X          register int    num,
  391. X                  i;
  392. X  
  393. X!         for (i = 0, num = exp, exp = 1; i < num; i++) {
  394. X              int    pos = calc_pos(linebuf, curchar);
  395. X  
  396. X              if (!eolp()) {
  397. X                  if (linebuf[curchar] == '\t') {
  398. X                      if ((pos + 1) == ((pos + tabstop) - (pos % tabstop)))
  399. X!                         DelNChar();
  400. X                  } else
  401. X!                     DelNChar();
  402. X              }
  403. X!             Insert(LastKeyStruck);
  404. X          }
  405. X      } else
  406. X          Insert(LastKeyStruck);
  407. X--- 114,130 ----
  408. X          register int    num,
  409. X                  i;
  410. X  
  411. X!         for (i = 0, num = arg_value(); i < num; i++) {
  412. X              int    pos = calc_pos(linebuf, curchar);
  413. X  
  414. X              if (!eolp()) {
  415. X                  if (linebuf[curchar] == '\t') {
  416. X                      if ((pos + 1) == ((pos + tabstop) - (pos % tabstop)))
  417. X!                         del_char(FORWARD, 1);
  418. X                  } else
  419. X!                     del_char(FORWARD, 1);
  420. X              }
  421. X!             insert_c(LastKeyStruck, 1);
  422. X          }
  423. X      } else
  424. X          Insert(LastKeyStruck);
  425. X***************
  426. X*** 139,151 ****
  427. X  
  428. X  Insert(c)
  429. X  {
  430. X!     if (exp <= 0)
  431. X          return;
  432. X      modify();
  433. X      makedirty(curline);
  434. X!     ins_c(c, linebuf, curchar, exp, LBSIZE);
  435. X!     IFixMarks(curline, curchar, curline, curchar + exp);
  436. X!     curchar += exp;
  437. X  }    
  438. X  
  439. X  /* Tab in to the right place for C mode */
  440. X--- 137,155 ----
  441. X  
  442. X  Insert(c)
  443. X  {
  444. X!     insert_c(c, arg_value());
  445. X! }
  446. X! 
  447. X! /* insert character C N times at point */
  448. X! insert_c(c, n)
  449. X! {
  450. X!     if (n <= 0)
  451. X          return;
  452. X      modify();
  453. X      makedirty(curline);
  454. X!     ins_c(c, linebuf, curchar, n, LBSIZE);
  455. X!     IFixMarks(curline, curchar, curline, curchar + n);
  456. X!     curchar += n;
  457. X  }    
  458. X  
  459. X  /* Tab in to the right place for C mode */
  460. X***************
  461. X*** 159,165 ****
  462. X  
  463. X          ToIndent();
  464. X          if (dotchar > curchar)
  465. X!             m = MakeMark(curline, dotchar, FLOATER);
  466. X          (void) lisp_indent();
  467. X          if (m) {
  468. X              ToMark(m);
  469. X--- 163,169 ----
  470. X  
  471. X          ToIndent();
  472. X          if (dotchar > curchar)
  473. X!             m = MakeMark(curline, dotchar, M_FLOATER);
  474. X          (void) lisp_indent();
  475. X          if (m) {
  476. X              ToMark(m);
  477. X***************
  478. X*** 177,191 ****
  479. X  
  480. X  QuotChar()
  481. X  {
  482. X!     int    c;
  483. X!     extern int    alarmed;    /* If waitfor had to wait. */
  484. X  
  485. X!     c = waitchar();
  486. X!     if (alarmed)
  487. X          message(key_strokes);
  488. X!     if (c == CTL(J))
  489. X!         LineInsert(exp);
  490. X!     else if (c != CTL(@))
  491. X          Insert(c);
  492. X  }
  493. X  
  494. X--- 181,195 ----
  495. X  
  496. X  QuotChar()
  497. X  {
  498. X!     int    c,
  499. X!         slow;
  500. X  
  501. X!     c = waitchar(&slow);
  502. X!     if (slow)
  503. X          message(key_strokes);
  504. X!     if (c == CTL('J'))
  505. X!         LineInsert(arg_value());
  506. X!     else if (c != CTL('@'))
  507. X          Insert(c);
  508. X  }
  509. X  
  510. X***************
  511. X*** 215,224 ****
  512. X  #endif
  513. X      SelfInsert();
  514. X      if (MinorMode(ShowMatch) && !charp() && !in_macro()) {
  515. X!         BackChar();    /* Back onto the ')' */
  516. X          if ((int) bp == -1)
  517. X              bp = m_paren(c, BACKWARD, NO, YES);
  518. X!         ForChar();
  519. X          if (bp != 0) {
  520. X              nx = in_window(curwind, bp->p_line);
  521. X              if (nx != -1) {        /* is visible */
  522. X--- 219,228 ----
  523. X  #endif
  524. X      SelfInsert();
  525. X      if (MinorMode(ShowMatch) && !charp() && !in_macro()) {
  526. X!         b_char(1);    /* Back onto the ')' */
  527. X          if ((int) bp == -1)
  528. X              bp = m_paren(c, BACKWARD, NO, YES);
  529. X!         f_char(1);
  530. X          if (bp != 0) {
  531. X              nx = in_window(curwind, bp->p_line);
  532. X              if (nx != -1) {        /* is visible */
  533. X***************
  534. X*** 264,279 ****
  535. X  #ifdef LISP
  536. X      if (MajorMode(LISPMODE))
  537. X          DelWtSpace();
  538. X  #endif
  539. X!     else if (blnkp(linebuf))
  540. X          DelWtSpace();
  541. X          
  542. X      /* If there is more than 2 blank lines in a row then don't make
  543. X         a newline, just move down one. */
  544. X!     if (exp == 1 && eolp() && TwoBlank())
  545. X          SetLine(curline->l_next);
  546. X      else
  547. X!         LineInsert(exp);
  548. X  
  549. X      if (indentp)
  550. X  #ifdef LISP
  551. X--- 268,284 ----
  552. X  #ifdef LISP
  553. X      if (MajorMode(LISPMODE))
  554. X          DelWtSpace();
  555. X+     else
  556. X  #endif
  557. X!         if (blnkp(linebuf))
  558. X          DelWtSpace();
  559. X          
  560. X      /* If there is more than 2 blank lines in a row then don't make
  561. X         a newline, just move down one. */
  562. X!     if (arg_value() == 1 && eolp() && TwoBlank())
  563. X          SetLine(curline->l_next);
  564. X      else
  565. X!         LineInsert(arg_value());
  566. X  
  567. X      if (indentp)
  568. X  #ifdef LISP
  569. X***************
  570. X*** 292,298 ****
  571. X      int    llen;
  572. X  
  573. X      if (*str == 0)
  574. X!         return;    /* ain't nothing to insert! */
  575. X      DOTsave(&save);
  576. X      llen = strlen(linebuf);
  577. X      while (c = *str++) {
  578. X--- 297,303 ----
  579. X      int    llen;
  580. X  
  581. X      if (*str == 0)
  582. X!         return;        /* ain't nothing to insert! */
  583. X      DOTsave(&save);
  584. X      llen = strlen(linebuf);
  585. X      while (c = *str++) {
  586. X***************
  587. X*** 314,328 ****
  588. X      makedirty(curline);
  589. X  }
  590. X  
  591. X! OpenLine()
  592. X  {
  593. X      Bufpos    dot;
  594. X  
  595. X      DOTsave(&dot);
  596. X!     LineInsert(exp);    /* Open the lines... */
  597. X      SetDot(&dot);
  598. X  }
  599. X  
  600. X  /* Take the region FLINE/FCHAR to TLINE/TCHAR and insert it at
  601. X     ATLINE/ATCHAR in WHATBUF. */
  602. X  
  603. X--- 319,338 ----
  604. X      makedirty(curline);
  605. X  }
  606. X  
  607. X! open_lines(n)
  608. X  {
  609. X      Bufpos    dot;
  610. X  
  611. X      DOTsave(&dot);
  612. X!     LineInsert(n);    /* Open the lines... */
  613. X      SetDot(&dot);
  614. X  }
  615. X  
  616. X+ OpenLine()
  617. X+ {
  618. X+     open_lines(arg_value());
  619. X+ }
  620. X+ 
  621. X  /* Take the region FLINE/FCHAR to TLINE/TCHAR and insert it at
  622. X     ATLINE/ATCHAR in WHATBUF. */
  623. X  
  624. X***************
  625. X*** 392,398 ****
  626. X  
  627. X      /* Now must find a recently killed region. */
  628. X  
  629. X!     if (exp < 0)
  630. X          dir = 1;
  631. X  
  632. X      killptr += dir;
  633. X--- 402,408 ----
  634. X  
  635. X      /* Now must find a recently killed region. */
  636. X  
  637. X!     if (arg_value() < 0)
  638. X          dir = 1;
  639. X  
  640. X      killptr += dir;
  641. X***************
  642. X*** 468,474 ****
  643. X      }
  644. X  }
  645. X  
  646. X! static
  647. X  newchunk()
  648. X  {
  649. X      register Line    *newline;
  650. X--- 478,484 ----
  651. X      }
  652. X  }
  653. X  
  654. X! private
  655. X  newchunk()
  656. X  {
  657. X      register Line    *newline;
  658. X***************
  659. X*** 520,526 ****
  660. X  /* Remove the free lines, in chunk c, from the free list because they are
  661. X     no longer free. */
  662. X  
  663. X! static
  664. X  remfreelines(c)
  665. X  register struct chunk    *c;
  666. X  {
  667. X--- 530,536 ----
  668. X  /* Remove the free lines, in chunk c, from the free list because they are
  669. X     no longer free. */
  670. X  
  671. X! private
  672. X  remfreelines(c)
  673. X  register struct chunk    *c;
  674. X  {
  675. X***************
  676. X*** 584,595 ****
  677. X      DOTsave(&dot);
  678. X      FSexpr();
  679. X      DOTsave(&end);
  680. X-     exp = 1;
  681. X      SetDot(&dot);
  682. X      for (;;) {
  683. X          if (curline == end.p_line)
  684. X              break;
  685. X!         line_move(FORWARD, NO);
  686. X          if (!blnkp(linebuf))
  687. X              (void) lisp_indent();
  688. X      }
  689. X--- 594,604 ----
  690. X      DOTsave(&dot);
  691. X      FSexpr();
  692. X      DOTsave(&end);
  693. X      SetDot(&dot);
  694. X      for (;;) {
  695. X          if (curline == end.p_line)
  696. X              break;
  697. X!         line_move(FORWARD, 1, NO);
  698. X          if (!blnkp(linebuf))
  699. X              (void) lisp_indent();
  700. X      }
  701. X***************
  702. X*** 656,662 ****
  703. X  
  704. X      DOTsave(&savedot);
  705. X      SetDot(bp);
  706. X!     DoTimes(ForChar(), 1);
  707. X      if (linebuf[curchar] != '(') {
  708. X          register Word    *wp;
  709. X  
  710. X--- 665,671 ----
  711. X  
  712. X      DOTsave(&savedot);
  713. X      SetDot(bp);
  714. X!     f_char(1);
  715. X      if (linebuf[curchar] != '(') {
  716. X          register Word    *wp;
  717. X  
  718. X***************
  719. X*** 669,675 ****
  720. X              int    c_char = curchar;
  721. X  
  722. X              WITH_TABLE(curbuf->b_major)
  723. X!                 ForWord();
  724. X              END_TABLE();
  725. X              if (LookingAt("[ \t]*;\\|[ \t]*$", linebuf, curchar))
  726. X                  curchar = c_char;
  727. X--- 678,684 ----
  728. X              int    c_char = curchar;
  729. X  
  730. X              WITH_TABLE(curbuf->b_major)
  731. X!                 f_word(1);
  732. X              END_TABLE();
  733. X              if (LookingAt("[ \t]*;\\|[ \t]*$", linebuf, curchar))
  734. X                  curchar = c_char;
  735. Xdiff -c ojove/io.c jove/io.c
  736. X*** ojove/io.c    Thu Jul 16 09:14:28 1987
  737. X--- jove/io.c    Fri Jun 19 16:00:59 1987
  738. X***************
  739. X*** 107,115 ****
  740. X      }
  741. X      DOTsave(&save);
  742. X      dofread(fp);
  743. X!     SetDot(&save);
  744. X!     if (is_insert && io_chars > 0)
  745. X          modify();
  746. X      getDOT();
  747. X      close_file(fp);
  748. X  }
  749. X--- 107,117 ----
  750. X      }
  751. X      DOTsave(&save);
  752. X      dofread(fp);
  753. X!     if (is_insert && io_chars > 0) {
  754. X          modify();
  755. X+         set_mark();
  756. X+     }
  757. X+     SetDot(&save);
  758. X      getDOT();
  759. X      close_file(fp);
  760. X  }
  761. X***************
  762. X*** 121,127 ****
  763. X      int    xeof = 0;
  764. X      Line    *savel = curline;
  765. X      int    savec = curchar;
  766. X!     disk_line    f_getputl() ;
  767. X  
  768. X      strcpy(end, linebuf + curchar);
  769. X      xeof = f_gets(fp, linebuf + curchar, LBSIZE - curchar);
  770. X--- 123,129 ----
  771. X      int    xeof = 0;
  772. X      Line    *savel = curline;
  773. X      int    savec = curchar;
  774. X!     extern disk_line    f_getputl();
  775. X  
  776. X      strcpy(end, linebuf + curchar);
  777. X      xeof = f_gets(fp, linebuf + curchar, LBSIZE - curchar);
  778. X***************
  779. X*** 157,169 ****
  780. X  #ifndef CHDIR
  781. X  
  782. X  char *
  783. X! pr_name(fname)
  784. X  char    *fname;
  785. X  {
  786. X      if (fname == 0)
  787. X          return 0;
  788. X  
  789. X!     if (strncmp(fname, HomeDir, HomeLen) == 0) {
  790. X          static char    name_buf[100];
  791. X  
  792. X          sprintf(name_buf, "~%s", fname + HomeLen);
  793. X--- 159,171 ----
  794. X  #ifndef CHDIR
  795. X  
  796. X  char *
  797. X! pr_name(fname, okay_home)
  798. X  char    *fname;
  799. X  {
  800. X      if (fname == 0)
  801. X          return 0;
  802. X  
  803. X!     if (okay_home == YES && strncmp(fname, HomeDir, HomeLen) == 0) {
  804. X          static char    name_buf[100];
  805. X  
  806. X          sprintf(name_buf, "~%s", fname + HomeLen);
  807. X***************
  808. X*** 188,194 ****
  809. X  }
  810. X  
  811. X  char *
  812. X! pr_name(fname)
  813. X  char    *fname;
  814. X  {
  815. X      int    n;
  816. X--- 190,196 ----
  817. X  }
  818. X  
  819. X  char *
  820. X! pr_name(fname, okay_home)
  821. X  char    *fname;
  822. X  {
  823. X      int    n;
  824. X***************
  825. X*** 201,207 ****
  826. X          (fname[n] == '/'))
  827. X          return fname + n + 1;
  828. X  
  829. X!     if (strcmp(HomeDir, "/") != 0 && strncmp(fname, HomeDir, HomeLen) == 0) {
  830. X          static char    name_buf[100];
  831. X  
  832. X          sprintf(name_buf, "~%s", fname + HomeLen);
  833. X--- 203,209 ----
  834. X          (fname[n] == '/'))
  835. X          return fname + n + 1;
  836. X  
  837. X!     if (okay_home == YES && strcmp(HomeDir, "/") != 0 && strncmp(fname, HomeDir, HomeLen) == 0) {
  838. X          static char    name_buf[100];
  839. X  
  840. X          sprintf(name_buf, "~%s", fname + HomeLen);
  841. X***************
  842. X*** 256,268 ****
  843. X  
  844. X  getCWD()
  845. X  {
  846. X!     char    *cwd = getenv("CWD");
  847. X  #ifdef JOB_CONTROL
  848. X      extern char    *getwd();
  849. X      char    pathname[FILESIZE];
  850. X  #endif
  851. X  
  852. X      if (cwd == 0)
  853. X  #ifdef JOB_CONTROL
  854. X          cwd = getwd(pathname);
  855. X  #else
  856. X--- 258,273 ----
  857. X  
  858. X  getCWD()
  859. X  {
  860. X!     char    *cwd;
  861. X  #ifdef JOB_CONTROL
  862. X      extern char    *getwd();
  863. X      char    pathname[FILESIZE];
  864. X  #endif
  865. X  
  866. X+     cwd = getenv("CWD");
  867. X      if (cwd == 0)
  868. X+         cwd = getenv("PWD");
  869. X+     if (cwd == 0)
  870. X  #ifdef JOB_CONTROL
  871. X          cwd = getwd(pathname);
  872. X  #else
  873. X***************
  874. X*** 278,284 ****
  875. X  
  876. X      s_mess(": %f ");
  877. X      for (i = DirSP; i >= 0; i--)
  878. X!         add_mess("%s ", pr_name(DirStack[i]));
  879. X  }
  880. X  
  881. X  prCWD()
  882. X--- 283,289 ----
  883. X  
  884. X      s_mess(": %f ");
  885. X      for (i = DirSP; i >= 0; i--)
  886. X!         add_mess("%s ", pr_name(DirStack[i], YES));
  887. X  }
  888. X  
  889. X  prCWD()
  890. X***************
  891. X*** 339,344 ****
  892. X--- 344,350 ----
  893. X      return offset;
  894. X  }
  895. X  
  896. X+ private
  897. X  dfollow(file, into)
  898. X  char    *file,
  899. X      *into;
  900. X***************
  901. X*** 377,382 ****
  902. X--- 383,389 ----
  903. X  
  904. X  #endif CHDIR
  905. X  
  906. X+ private
  907. X  get_hdir(user, buf)
  908. X  register char    *user,
  909. X          *buf;
  910. X***************
  911. X*** 453,464 ****
  912. X  
  913. X  WrtReg()
  914. X  {
  915. X!     DoWriteReg(0);
  916. X  }
  917. X  
  918. X  AppReg()
  919. X  {
  920. X!     DoWriteReg(1);
  921. X  }
  922. X  
  923. X  int    CreatMode = DFLT_MODE;
  924. X--- 460,471 ----
  925. X  
  926. X  WrtReg()
  927. X  {
  928. X!     DoWriteReg(NO);
  929. X  }
  930. X  
  931. X  AppReg()
  932. X  {
  933. X!     DoWriteReg(YES);
  934. X  }
  935. X  
  936. X  int    CreatMode = DFLT_MODE;
  937. X***************
  938. X*** 474,480 ****
  939. X      fname = ask_file((char *) 0, (char *) 0, fnamebuf);
  940. X  
  941. X  #ifdef BACKUPFILES
  942. X!     if (!app) {
  943. X          filemunge(fname);
  944. X  
  945. X          if (BkupOnWrite)
  946. X--- 481,487 ----
  947. X      fname = ask_file((char *) 0, (char *) 0, fnamebuf);
  948. X  
  949. X  #ifdef BACKUPFILES
  950. X!     if (app == NO) {
  951. X          filemunge(fname);
  952. X  
  953. X          if (BkupOnWrite)
  954. X***************
  955. X*** 511,522 ****
  956. X  
  957. X      chk_mtime(curbuf, fname, "write");
  958. X      filemunge(fname);
  959. X!     curbuf->b_type = B_FILE;      /* In case it wasn't before. */
  960. X      setfname(curbuf, fname);
  961. X      file_write(fname, 0);
  962. X      unmodify();
  963. X  }
  964. X  
  965. X  File *
  966. X  open_file(fname, buf, how, ifbad, loudness)
  967. X  register char    *fname;
  968. X--- 518,545 ----
  969. X  
  970. X      chk_mtime(curbuf, fname, "write");
  971. X      filemunge(fname);
  972. X!     curbuf->b_type = B_FILE;      /* in case it wasn't before */
  973. X      setfname(curbuf, fname);
  974. X      file_write(fname, 0);
  975. X      unmodify();
  976. X  }
  977. X  
  978. X+ /* Open file FNAME supplying the buffer IO routine with buffer BUF.
  979. X+    HOW is F_READ, F_WRITE or F_APPEND.  IFBAD == COMPLAIN means that
  980. X+    if we fail at opening the file, call complain.  LOUDNESS says
  981. X+    whether or not to print the "reading ..." message on the message
  982. X+    line.
  983. X+ 
  984. X+    NOTE:  This opens the pr_name(fname, NO) of fname.  That is, FNAME
  985. X+       is usually an entire pathname, which can be slow when the
  986. X+       pathname is long and there are lots of symbolic links along
  987. X+       the way (which has become very common in my experience).  So,
  988. X+       this speeds up opens file names in the local directory.  It
  989. X+       will not speed up things like "../scm/foo.scm" simple because
  990. X+       by the time we get here that's already been expanded to an
  991. X+       absolute pathname.  But this is a start.
  992. X+    */
  993. X+ 
  994. X  File *
  995. X  open_file(fname, buf, how, ifbad, loudness)
  996. X  register char    *fname;
  997. X***************
  998. X*** 529,535 ****
  999. X      io_lines = 0;
  1000. X      tellall = loudness;
  1001. X  
  1002. X!     fp = f_open(fname, how, buf, LBSIZE);
  1003. X      if (fp == NIL) {
  1004. X                  message(IOerr((how == F_READ) ? "open" : "create", fname));
  1005. X          if (ifbad == COMPLAIN)
  1006. X--- 552,558 ----
  1007. X      io_lines = 0;
  1008. X      tellall = loudness;
  1009. X  
  1010. X!     fp = f_open(pr_name(fname, NO), how, buf, LBSIZE);
  1011. X      if (fp == NIL) {
  1012. X                  message(IOerr((how == F_READ) ? "open" : "create", fname));
  1013. X          if (ifbad == COMPLAIN)
  1014. X***************
  1015. X*** 537,547 ****
  1016. X      } else {
  1017. X          int    readonly = FALSE;
  1018. X  
  1019. X!         if (access(fname, W_OK) == -1 && errno != ENOENT)
  1020. X              readonly = TRUE;
  1021. X                               
  1022. X          if (loudness != QUIET)
  1023. X!             f_mess("\"%s\"%s", pr_name(fname),
  1024. X                     readonly ? " [Read only]" : NullStr);
  1025. X      }
  1026. X      return fp;
  1027. X--- 560,570 ----
  1028. X      } else {
  1029. X          int    readonly = FALSE;
  1030. X  
  1031. X!         if (access(pr_name(fname, NO), W_OK) == -1 && errno != ENOENT)
  1032. X              readonly = TRUE;
  1033. X                               
  1034. X          if (loudness != QUIET)
  1035. X!             f_mess("\"%s\"%s", pr_name(fname, YES),
  1036. X                     readonly ? " [Read only]" : NullStr);
  1037. X      }
  1038. X      return fp;
  1039. X***************
  1040. X*** 552,559 ****
  1041. X     doing.
  1042. X  
  1043. X     I hate to use another stat(), but to use confirm we gotta
  1044. X!    do this before we open the file. */
  1045. X  
  1046. X  chk_mtime(thisbuf, fname, how)
  1047. X  Buffer    *thisbuf;
  1048. X  char    *fname,
  1049. X--- 575,586 ----
  1050. X     doing.
  1051. X  
  1052. X     I hate to use another stat(), but to use confirm we gotta
  1053. X!    do this before we open the file.
  1054. X  
  1055. X+    NOTE: This stats FNAME after converting it to a path-relative
  1056. X+      name.  I can't see why this would cause a problem ...
  1057. X+    */
  1058. X+ 
  1059. X  chk_mtime(thisbuf, fname, how)
  1060. X  Buffer    *thisbuf;
  1061. X  char    *fname,
  1062. X***************
  1063. X*** 566,577 ****
  1064. X      if ((thisbuf->b_mtime != 0) &&        /* if we care ... */
  1065. X          (b = file_exists(fname)) &&        /* we already have this file */
  1066. X          (b == thisbuf) &&            /* and it's the current buffer */
  1067. X!         (stat(fname, &stbuf) != -1) &&    /* and we can stat it */
  1068. X          (stbuf.st_mtime != b->b_mtime)) {    /* and there's trouble. */
  1069. X              rbell();
  1070. X          redisplay();    /* Ring that bell! */
  1071. X              TOstart("Warning", TRUE);
  1072. X!             Typeout("\"%s\" now saved on disk is not what you last", pr_name(fname));
  1073. X          Typeout("visited or saved.  Probably someone else is editing");
  1074. X          Typeout("your file at the same time.");
  1075. X              if (how) {
  1076. X--- 593,604 ----
  1077. X      if ((thisbuf->b_mtime != 0) &&        /* if we care ... */
  1078. X          (b = file_exists(fname)) &&        /* we already have this file */
  1079. X          (b == thisbuf) &&            /* and it's the current buffer */
  1080. X!         (stat(pr_name(fname, NO), &stbuf) != -1) &&    /* and we can stat it */
  1081. X          (stbuf.st_mtime != b->b_mtime)) {    /* and there's trouble. */
  1082. X              rbell();
  1083. X          redisplay();    /* Ring that bell! */
  1084. X              TOstart("Warning", TRUE);
  1085. X!             Typeout("\"%s\" now saved on disk is not what you last", pr_name(fname, YES));
  1086. X          Typeout("visited or saved.  Probably someone else is editing");
  1087. X          Typeout("your file at the same time.");
  1088. X              if (how) {
  1089. X***************
  1090. X*** 626,632 ****
  1091. X          for (;;) {
  1092. X              rbell();
  1093. X              y_or_n = ask(NullStr, "Shall I make your changes to \"%s\" permanent? ", curbuf->b_name);
  1094. X!             c = Upper(*y_or_n);
  1095. X              if (c == 'Y' || c == 'N')
  1096. X                  break;
  1097. X          }            
  1098. X--- 653,659 ----
  1099. X          for (;;) {
  1100. X              rbell();
  1101. X              y_or_n = ask(NullStr, "Shall I make your changes to \"%s\" permanent? ", curbuf->b_name);
  1102. X!             c = CharUpcase(*y_or_n);
  1103. X              if (c == 'Y' || c == 'N')
  1104. X                  break;
  1105. X          }            
  1106. X***************
  1107. X*** 658,664 ****
  1108. X  
  1109. X  private int    nleft,    /* number of good characters left in current block */
  1110. X          tmpfd = -1;
  1111. X! private disk_line    DFree = 1;
  1112. X              /* pointer to end of tmp file */
  1113. X  private char    *tfname;
  1114. X  
  1115. X--- 685,691 ----
  1116. X  
  1117. X  private int    nleft,    /* number of good characters left in current block */
  1118. X          tmpfd = -1;
  1119. X! disk_line    DFree = 1;
  1120. X              /* pointer to end of tmp file */
  1121. X  private char    *tfname;
  1122. X  
  1123. X***************
  1124. X*** 682,691 ****
  1125. X      (void) unlink(tfname);
  1126. X  }
  1127. X  
  1128. X! /* Get a line at `tl' in the tmp file into `buf' which should be LBSIZE
  1129. X!    long. */
  1130. X  
  1131. X! int    Jr_Len;        /* Length of Just Read Line. */
  1132. X  private char    *getblock();
  1133. X  
  1134. X  getline(addr, buf)
  1135. X--- 709,718 ----
  1136. X      (void) unlink(tfname);
  1137. X  }
  1138. X  
  1139. X! /* get a line at `tl' in the tmp file into `buf' which should be LBSIZE
  1140. X!    long */
  1141. X  
  1142. X! int    Jr_Len;        /* length of Just Read Line */
  1143. X  private char    *getblock();
  1144. X  
  1145. X  getline(addr, buf)
  1146. Xdiff -c ojove/iproc-pipes.c jove/iproc-pipes.c
  1147. X*** ojove/iproc-pipes.c    Thu Jul 16 09:14:30 1987
  1148. X--- jove/iproc-pipes.c    Thu Jun 25 10:02:30 1987
  1149. X***************
  1150. X*** 13,20 ****
  1151. X  #include <signal.h>
  1152. X  #include <sgtty.h>
  1153. X  
  1154. X- typedef struct process    Process;
  1155. X- 
  1156. X  #define DEAD    1    /* Dead but haven't informed user yet */
  1157. X  #define STOPPED    2    /* Job stopped */
  1158. X  #define RUNNING    3    /* Just running */
  1159. X--- 13,18 ----
  1160. X***************
  1161. X*** 25,30 ****
  1162. X--- 23,29 ----
  1163. X  #define KILLED    2
  1164. X  
  1165. X  #define isdead(p)    (p == 0 || proc_state(p) == DEAD || p->p_toproc == -1)
  1166. X+ #define makedead(p)    (proc_state(p) = DEAD)
  1167. X  
  1168. X  #define proc_buf(p)    (p->p_buffer->b_name)
  1169. X  #define proc_cmd(p)    (p->p_name)
  1170. X***************
  1171. X*** 36,42 ****
  1172. X      ProcOutput,
  1173. X      NumProcs = 0;
  1174. X  
  1175. X! static char *
  1176. X  pstate(p)
  1177. X  Process    *p;
  1178. X  {
  1179. X--- 35,41 ----
  1180. X      ProcOutput,
  1181. X      NumProcs = 0;
  1182. X  
  1183. X! char *
  1184. X  pstate(p)
  1185. X  Process    *p;
  1186. X  {
  1187. X***************
  1188. X*** 54,65 ****
  1189. X          if (p->p_howdied == EXITED) {
  1190. X              if (p->p_reason == 0)
  1191. X                  return "Done";
  1192. X!             return sprint("[Exit %d]", p->p_reason);
  1193. X          }
  1194. X!         return sprint("[Killed %d]", p->p_reason);
  1195. X  
  1196. X      default:
  1197. X!         return "Unknown state.";
  1198. X      }
  1199. X  }
  1200. X  
  1201. X--- 53,64 ----
  1202. X          if (p->p_howdied == EXITED) {
  1203. X              if (p->p_reason == 0)
  1204. X                  return "Done";
  1205. X!             return sprint("Exit %d", p->p_reason);
  1206. X          }
  1207. X!         return sprint("Killed %d", p->p_reason);
  1208. X  
  1209. X      default:
  1210. X!         return "Unknown state";
  1211. X      }
  1212. X  }
  1213. X  
  1214. X***************
  1215. X*** 98,104 ****
  1216. X              finish(1);
  1217. X          read_proc(header.pid, header.nbytes);
  1218. X      }
  1219. X-     redisplay();
  1220. X      here = 0;
  1221. X      sigrelse(SIGCHLD);
  1222. X  }
  1223. X--- 97,102 ----
  1224. X***************
  1225. X*** 126,132 ****
  1226. X      }
  1227. X  
  1228. X      if (nbytes == EOF) {        /* Okay to clean up this process */
  1229. X!         p->p_eof = 1;
  1230. X          NumProcs--;    /* As far as getch() in main is concerned */
  1231. X          return;
  1232. X      }
  1233. X--- 124,130 ----
  1234. X      }
  1235. X  
  1236. X      if (nbytes == EOF) {        /* Okay to clean up this process */
  1237. X!         proc_close(p);
  1238. X          NumProcs--;    /* As far as getch() in main is concerned */
  1239. X          return;
  1240. X      }
  1241. X***************
  1242. X*** 155,166 ****
  1243. X      proc_kill(curbuf->b_process, SIGQUIT);
  1244. X  }
  1245. X  
  1246. X! static
  1247. X  proc_close(p)
  1248. X  Process    *p;
  1249. X  {
  1250. X      (void) close(p->p_toproc);
  1251. X!     p->p_toproc = -1;    /* Writes will fail. */
  1252. X  }
  1253. X  
  1254. X  do_rtp(mp)
  1255. X--- 153,164 ----
  1256. X      proc_kill(curbuf->b_process, SIGQUIT);
  1257. X  }
  1258. X  
  1259. X! private
  1260. X  proc_close(p)
  1261. X  Process    *p;
  1262. X  {
  1263. X      (void) close(p->p_toproc);
  1264. X!     p->p_toproc = -1;    /* writes will fail */
  1265. X  }
  1266. X  
  1267. X  do_rtp(mp)
  1268. X***************
  1269. X*** 228,234 ****
  1270. X          (void) dup2(ProcOutput, 1);
  1271. X          (void) dup2(ProcOutput, 2);
  1272. X          pclose(toproc);
  1273. X!         execv(Portsrv, args);
  1274. X          printf("Execl failed.\n");
  1275. X          _exit(1);
  1276. X      }
  1277. X--- 226,232 ----
  1278. X          (void) dup2(ProcOutput, 1);
  1279. X          (void) dup2(ProcOutput, 2);
  1280. X          pclose(toproc);
  1281. X!         execv(Portsrv, argv);
  1282. X          printf("Execl failed.\n");
  1283. X          _exit(1);
  1284. X      }
  1285. X***************
  1286. X*** 260,270 ****
  1287. X      /* Pop_wind() after everything is set up; important!
  1288. X         Bindings won't work right unless newbuf->b_process is already
  1289. X         set up BEFORE NEWBUF is first SetBuf()'d. */
  1290. X!     newp->p_mark = MakeMark(curline, curchar, FLOATER);
  1291. X  
  1292. X      newp->p_toproc = toproc[1];
  1293. X      newp->p_reason = 0;
  1294. X-     newp->p_eof = 0;
  1295. X      NumProcs++;
  1296. X      (void) close(toproc[0]);
  1297. X      sigrelse(SIGCHLD);
  1298. X--- 258,267 ----
  1299. X      /* Pop_wind() after everything is set up; important!
  1300. X         Bindings won't work right unless newbuf->b_process is already
  1301. X         set up BEFORE NEWBUF is first SetBuf()'d. */
  1302. X!     newp->p_mark = MakeMark(curline, curchar, M_FLOATER);
  1303. X  
  1304. X      newp->p_toproc = toproc[1];
  1305. X      newp->p_reason = 0;
  1306. X      NumProcs++;
  1307. X      (void) close(toproc[0]);
  1308. X      sigrelse(SIGCHLD);
  1309. Xdiff -c ojove/iproc-ptys.c jove/iproc-ptys.c
  1310. X*** ojove/iproc-ptys.c    Thu Jul 16 09:14:31 1987
  1311. X--- jove/iproc-ptys.c    Thu Jun 25 10:01:44 1987
  1312. X***************
  1313. X*** 12,17 ****
  1314. X--- 12,18 ----
  1315. X  #endif
  1316. X  #include <signal.h>
  1317. X  #include <sgtty.h>
  1318. X+ #include <errno.h>
  1319. X  
  1320. X  #define DEAD    1    /* Dead but haven't informed user yet */
  1321. X  #define STOPPED    2    /* Job stopped */
  1322. X***************
  1323. X*** 23,28 ****
  1324. X--- 24,30 ----
  1325. X  #define KILLED    2
  1326. X  
  1327. X  #define isdead(p)    (p == 0 || proc_state(p) == DEAD || p->p_fd == -1)
  1328. X+ #define makedead(p)    (proc_state(p) = DEAD)
  1329. X  
  1330. X  #define proc_buf(p)    (p->p_buffer->b_name)
  1331. X  #define proc_cmd(p)    (p->p_name)
  1332. X***************
  1333. X*** 45,51 ****
  1334. X      extern struct ltchars ls1;
  1335. X  #endif
  1336. X  
  1337. X! static char *
  1338. X  pstate(p)
  1339. X  Process    *p;
  1340. X  {
  1341. X--- 47,53 ----
  1342. X      extern struct ltchars ls1;
  1343. X  #endif
  1344. X  
  1345. X! char *
  1346. X  pstate(p)
  1347. X  Process    *p;
  1348. X  {
  1349. X***************
  1350. X*** 60,71 ****
  1351. X          if (p->p_howdied == EXITED) {
  1352. X              if (p->p_reason == 0)
  1353. X                  return "Done";
  1354. X!             return sprint("exit(%d)", p->p_reason);
  1355. X          }
  1356. X!         return sprint("Killed(%d)", p->p_reason);
  1357. X  
  1358. X      default:
  1359. X!         return "Unknown state.";
  1360. X      }
  1361. X  }
  1362. X  
  1363. X--- 62,73 ----
  1364. X          if (p->p_howdied == EXITED) {
  1365. X              if (p->p_reason == 0)
  1366. X                  return "Done";
  1367. X!             return sprint("Exit %d", p->p_reason);
  1368. X          }
  1369. X!         return sprint("Killed %d", p->p_reason);
  1370. X  
  1371. X      default:
  1372. X!         return "Unknown state";
  1373. X      }
  1374. X  }
  1375. X  
  1376. X***************
  1377. X*** 98,111 ****
  1378. X      }
  1379. X  
  1380. X      n = read(fd, ibuf, sizeof(ibuf) - 1);
  1381. X!     if (n == 0) {
  1382. X!         proc_close(p);
  1383. X!         NumProcs--;
  1384. X          return;
  1385. X      }
  1386. X      ibuf[n] = '\0';
  1387. X      proc_rec(p, ibuf);
  1388. X-     redisplay();
  1389. X  }
  1390. X  
  1391. X  ProcKill()
  1392. X--- 100,123 ----
  1393. X      }
  1394. X  
  1395. X      n = read(fd, ibuf, sizeof(ibuf) - 1);
  1396. X!     /* NOTE: This read somethings returns -1 when it's the first time
  1397. X!        we're reading the socket.  Errno was set to I/O error or something
  1398. X!        bizarre like that.  So, I'm choosing to ignore this.  I ignored
  1399. X!        it before, and what happened was random text was being inserted
  1400. X!        at the beginning of the buffer because the ibuf[n] = '\0' wasn't
  1401. X!         working right (ibuf[-1] = '\0'). */
  1402. X!     if (n == -1 && errno == EIO)
  1403. X          return;
  1404. X+     if (n <= 0) {
  1405. X+         if (n == 0) {
  1406. X+             makedead(p);
  1407. X+             return;
  1408. X+         }
  1409. X+         sprintf(ibuf, "\n[pty read error: %d]\n", errno);
  1410. X+         n = strlen(ibuf);
  1411. X      }
  1412. X      ibuf[n] = '\0';
  1413. X      proc_rec(p, ibuf);
  1414. X  }
  1415. X  
  1416. X  ProcKill()
  1417. X***************
  1418. X*** 171,183 ****
  1419. X      (void) write(p->p_fd, &c, 1);
  1420. X  }
  1421. X  
  1422. X! static
  1423. X  proc_close(p)
  1424. X  Process *p;
  1425. X  {
  1426. X      (void) close(p->p_fd);
  1427. X      global_fd &= ~(1 << p->p_fd);
  1428. X-     p->p_eof++;
  1429. X  }
  1430. X  
  1431. X  do_rtp(mp)
  1432. X--- 183,194 ----
  1433. X      (void) write(p->p_fd, &c, 1);
  1434. X  }
  1435. X  
  1436. X! private
  1437. X  proc_close(p)
  1438. X  Process *p;
  1439. X  {
  1440. X      (void) close(p->p_fd);
  1441. X      global_fd &= ~(1 << p->p_fd);
  1442. X  }
  1443. X  
  1444. X  do_rtp(mp)
  1445. X***************
  1446. X*** 216,222 ****
  1447. X      va_list    ap;
  1448. X      char    *argv[32],
  1449. X          *cp;
  1450. X!     Window *owind    = curwind;
  1451. X      int    pid;
  1452. X      Process    *newp;
  1453. X      Buffer     *newbuf;
  1454. X--- 227,233 ----
  1455. X      va_list    ap;
  1456. X      char    *argv[32],
  1457. X          *cp;
  1458. X!     Window *owind = curwind;
  1459. X      int    pid;
  1460. X      Process    *newp;
  1461. X      Buffer     *newbuf;
  1462. X***************
  1463. X*** 348,354 ****
  1464. X  
  1465. X      newp->p_fd = ttyfd;
  1466. X      newp->p_pid = pid;
  1467. X-     newp->p_eof = 0;
  1468. X  
  1469. X      newbuf = do_select((Window *) 0, bufname);
  1470. X      newbuf->b_type = B_PROCESS;
  1471. X--- 359,364 ----
  1472. X***************
  1473. X*** 371,377 ****
  1474. X      newp->p_name = copystr(cmdbuf);
  1475. X      newp->p_state = RUNNING;
  1476. X      newp->p_reason = 0;
  1477. X!     newp->p_mark = MakeMark(curline, curchar, FLOATER);
  1478. X  
  1479. X      newp->p_next = procs;
  1480. X      procs = newp;
  1481. X--- 381,387 ----
  1482. X      newp->p_name = copystr(cmdbuf);
  1483. X      newp->p_state = RUNNING;
  1484. X      newp->p_reason = 0;
  1485. X!     newp->p_mark = MakeMark(curline, curchar, M_FLOATER);
  1486. X  
  1487. X      newp->p_next = procs;
  1488. X      procs = newp;
  1489. Xdiff -c ojove/iproc.c jove/iproc.c
  1490. X*** ojove/iproc.c    Thu Jul 16 09:14:32 1987
  1491. X--- jove/iproc.c    Wed Jun 24 12:52:13 1987
  1492. X***************
  1493. X*** 30,36 ****
  1494. X          if (!isdead(p)) {
  1495. X              if (killem == -1) {
  1496. X                  yorn = ask("y", "Should I kill your i-processes? ");
  1497. X!                 killem = (Upper(*yorn) == 'Y');
  1498. X              }
  1499. X              if (killem)
  1500. X                  proc_kill(p, SIGKILL);
  1501. X--- 30,36 ----
  1502. X          if (!isdead(p)) {
  1503. X              if (killem == -1) {
  1504. X                  yorn = ask("y", "Should I kill your i-processes? ");
  1505. X!                 killem = (CharUpcase(*yorn) == 'Y');
  1506. X              }
  1507. X              if (killem)
  1508. X                  proc_kill(p, SIGKILL);
  1509. X***************
  1510. X*** 50,56 ****
  1511. X  /* Process receive: receives the characters in buf, and appends them to
  1512. X     the buffer associated with p. */
  1513. X  
  1514. X! static
  1515. X  proc_rec(p, buf)
  1516. X  register Process    *p;
  1517. X  char    *buf;
  1518. X--- 50,56 ----
  1519. X  /* Process receive: receives the characters in buf, and appends them to
  1520. X     the buffer associated with p. */
  1521. X  
  1522. X! private
  1523. X  proc_rec(p, buf)
  1524. X  register Process    *p;
  1525. X  char    *buf;
  1526. X***************
  1527. X*** 68,88 ****
  1528. X      if (w != 0)
  1529. X          do_disp = (in_window(w, p->p_mark->m_line) != -1);
  1530. X      SetBuf(p->p_buffer);
  1531. X!     savepoint = MakeMark(curline, curchar, FLOATER);
  1532. X!     ToMark(p->p_mark);    /* Where output last stopped. */
  1533. X      if (savepoint->m_line == curline && savepoint->m_char == curchar)
  1534. X          sameplace++;
  1535. X  
  1536. X      ins_str(buf, YES);
  1537. X      if (do_disp) {
  1538. X          w->w_line = curline;
  1539. X          w->w_char = curchar;
  1540. X          redisplay();
  1541. X      }
  1542. X-     MarkSet(p->p_mark, curline, curchar);
  1543. X-     if (!sameplace)
  1544. X-         ToMark(savepoint);    /* Back to where we were. */
  1545. X-     DelMark(savepoint);
  1546. X      SetBuf(saveb);
  1547. X  }
  1548. X  
  1549. X--- 68,91 ----
  1550. X      if (w != 0)
  1551. X          do_disp = (in_window(w, p->p_mark->m_line) != -1);
  1552. X      SetBuf(p->p_buffer);
  1553. X!     savepoint = MakeMark(curline, curchar, M_FLOATER);
  1554. X!     ToMark(p->p_mark);        /* where output last stopped */
  1555. X      if (savepoint->m_line == curline && savepoint->m_char == curchar)
  1556. X          sameplace++;
  1557. X  
  1558. X      ins_str(buf, YES);
  1559. X+     MarkSet(p->p_mark, curline, curchar);
  1560. X+     if (!sameplace)
  1561. X+         ToMark(savepoint);    /* back to where we were */
  1562. X+     DelMark(savepoint);
  1563. X+     /* redisplay now, instead of right after the ins_str, so that
  1564. X+        we don't get a bouncing effect if point is not the same as
  1565. X+        the process output position */
  1566. X      if (do_disp) {
  1567. X          w->w_line = curline;
  1568. X          w->w_char = curchar;
  1569. X          redisplay();
  1570. X      }
  1571. X      SetBuf(saveb);
  1572. X  }
  1573. X  
  1574. X***************
  1575. X*** 95,105 ****
  1576. X          s_mess("Cannot kill %s!", proc_buf(p));
  1577. X  }
  1578. X  
  1579. X! /* Deal with a process' death.  proc_rec turns on the FREEUP bit when it
  1580. X!    it gets the "EOF" from portsrv.  FREEUP'd processes get unlinked from
  1581. X!    the list, and the proc stucture and proc_buf(p) get free'd up, here. */
  1582. X  
  1583. X- private
  1584. X  DealWDeath()
  1585. X  {
  1586. X      register Process    *p,
  1587. X--- 98,107 ----
  1588. X          s_mess("Cannot kill %s!", proc_buf(p));
  1589. X  }
  1590. X  
  1591. X! /* Deal with a process' death.  Go through all processes and find
  1592. X!    the ones which have gotten EOF.  Delete them from the list and
  1593. X!    free up the memory, and insert a status string. */
  1594. X  
  1595. X  DealWDeath()
  1596. X  {
  1597. X      register Process    *p,
  1598. X***************
  1599. X*** 108,114 ****
  1600. X      
  1601. X      for (p = procs; p != 0; p = next) {
  1602. X          next = p->p_next;
  1603. X!         if (!p->p_eof) {
  1604. X              prev = p;
  1605. X              continue;
  1606. X          }
  1607. X--- 110,116 ----
  1608. X      
  1609. X      for (p = procs; p != 0; p = next) {
  1610. X          next = p->p_next;
  1611. X!         if (p->p_state != DEAD) {
  1612. X              prev = p;
  1613. X              continue;
  1614. X          }
  1615. X***************
  1616. X*** 130,135 ****
  1617. X--- 132,138 ----
  1618. X      char    *fmt = "%-15s  %-15s  %-8s %s",
  1619. X          pidstr[10];
  1620. X  
  1621. X+     DealWDeath();
  1622. X      if (procs == 0) {
  1623. X          message("[No subprocesses]");
  1624. X          return;
  1625. X***************
  1626. X*** 142,148 ****
  1627. X          sprintf(pidstr, "%d", p->p_pid);
  1628. X          Typeout(fmt, proc_buf(p), pstate(p), pidstr, p->p_name);
  1629. X      }
  1630. X-     DealWDeath();
  1631. X      TOstop();
  1632. X  }
  1633. X  
  1634. X--- 145,150 ----
  1635. X***************
  1636. X*** 160,168 ****
  1637. X--- 162,193 ----
  1638. X  SendData(newlinep)
  1639. X  {
  1640. X      register Process    *p = curbuf->b_process;
  1641. X+     register char    *lp,
  1642. X+             *gp;    /* JF fix for better prompt handling */
  1643. X  
  1644. X      if (isdead(p))
  1645. X          return;
  1646. X+     /* If the process mark was involved in a big deletion, because
  1647. X+        the user hit ^W or something, then let's do some magic with
  1648. X+        the process mark.  Problem is that if the user yanks back the
  1649. X+        text he deleted, the mark stays at the beginning of the region,
  1650. X+        and so the next time SendData() is called the entire region
  1651. X+        will be sent.  That's not good.  So, to deal with that we reset
  1652. X+        the mark to the last line, after skipping over the prompt, etc. */
  1653. X+     if (p->p_mark->m_flags & M_BIG_DELETE) {
  1654. X+         Bufpos    bp;
  1655. X+ 
  1656. X+         p->p_mark->m_flags &= ~M_BIG_DELETE;
  1657. X+ 
  1658. X+         DOTsave(&bp);
  1659. X+         ToLast();
  1660. X+         Bol();
  1661. X+         while (LookingAt(proc_prompt, linebuf, curchar))
  1662. X+             SetDot(dosearch(proc_prompt, 1, 1));
  1663. X+         MarkSet(p->p_mark, curline, curchar);
  1664. X+         SetDot(&bp);
  1665. X+     }
  1666. X+ 
  1667. X      if (lastp(curline)) {
  1668. X          Eol();
  1669. X          if (newlinep)
  1670. X***************
  1671. X*** 174,181 ****
  1672. X          while (LookingAt(proc_prompt, linebuf, curchar))
  1673. X              SetDot(dosearch(proc_prompt, 1, 1));
  1674. X          strcpy(genbuf, linebuf + curchar);
  1675. X!         ToLast();
  1676. X!         ins_str(genbuf, NO);
  1677. X      }
  1678. X  }
  1679. X  
  1680. X--- 199,210 ----
  1681. X          while (LookingAt(proc_prompt, linebuf, curchar))
  1682. X              SetDot(dosearch(proc_prompt, 1, 1));
  1683. X          strcpy(genbuf, linebuf + curchar);
  1684. X!         Eof();
  1685. X!         gp = genbuf;
  1686. X!         lp = linebuf;
  1687. X!         while (*lp == *gp && *lp != '\0')
  1688. X!             lp++, gp++;
  1689. X!         ins_str(gp, NO);
  1690. X      }
  1691. X  }
  1692. X  
  1693. X***************
  1694. X*** 222,233 ****
  1695. X  register int    pid;
  1696. X  union wait    w;
  1697. X  {
  1698. X-     char    str[128];
  1699. X      register Process    *child;
  1700. X  
  1701. X      if ((child = proc_pid(pid)) == 0)
  1702. X          return;
  1703. X  
  1704. X      if (WIFSTOPPED(w))
  1705. X          child->p_state = STOPPED;
  1706. X      else {
  1707. X--- 251,262 ----
  1708. X  register int    pid;
  1709. X  union wait    w;
  1710. X  {
  1711. X      register Process    *child;
  1712. X  
  1713. X      if ((child = proc_pid(pid)) == 0)
  1714. X          return;
  1715. X  
  1716. X+     UpdModLine = YES;        /* we're changing state ... */
  1717. X      if (WIFSTOPPED(w))
  1718. X          child->p_state = STOPPED;
  1719. X      else {
  1720. X***************
  1721. X*** 238,249 ****
  1722. X              child->p_reason = w.w_termsig;
  1723. X              child->p_howdied = KILLED;
  1724. X          }
  1725. X!         proc_close(child);
  1726. X      }
  1727. X-     sprintf(str, "[Process %s: %s]\n",
  1728. X-         proc_cmd(child),
  1729. X-         pstate(child));
  1730. X-     proc_rec(child, str);
  1731. X  }
  1732. X  
  1733. X  /* Push/pod process bindings.  I openly acknowledge that this is a
  1734. X--- 267,286 ----
  1735. X              child->p_reason = w.w_termsig;
  1736. X              child->p_howdied = KILLED;
  1737. X          }
  1738. X!         {
  1739. X!             Buffer    *save = curbuf;
  1740. X!             char    mesg[128];
  1741. X! 
  1742. X!             /* insert status message now */
  1743. X!             sprintf(mesg, "[Process %s: %s]\n",
  1744. X!                 proc_cmd(child),
  1745. X!                 pstate(child));
  1746. X!             SetBuf(child->p_buffer);
  1747. X!             ins_str(mesg, NO);
  1748. X!             SetBuf(save);
  1749. X!             redisplay();
  1750. X!         }
  1751. X      }
  1752. X  }
  1753. X  
  1754. X  /* Push/pod process bindings.  I openly acknowledge that this is a
  1755. Xdiff -c ojove/jove.c jove/jove.c
  1756. X*** ojove/jove.c    Thu Jul 16 09:14:35 1987
  1757. X--- jove/jove.c    Fri Jul 10 09:25:50 1987
  1758. X***************
  1759. X*** 20,27 ****
  1760. X  #include <sgtty.h>
  1761. X  #else
  1762. X  #include <termio.h>
  1763. X- #endif SYSV
  1764. X  #include <fcntl.h>
  1765. X  
  1766. X  #ifdef TIOCSLTC
  1767. X  struct ltchars    ls1,
  1768. X--- 20,27 ----
  1769. X  #include <sgtty.h>
  1770. X  #else
  1771. X  #include <termio.h>
  1772. X  #include <fcntl.h>
  1773. X+ #endif SYSV
  1774. X  
  1775. X  #ifdef TIOCSLTC
  1776. X  struct ltchars    ls1,
  1777. X***************
  1778. X*** 62,71 ****
  1779. X      int    CoreDump = (code != 0 && code != SIGHUP),
  1780. X          DelTmps = 1;        /* Usually we delete them. */
  1781. X  
  1782. X- #ifdef LSRHS
  1783. X-     if (CoreDump)
  1784. X-         setdump(1);
  1785. X- #endif
  1786. X      if (code == SIGINT) {
  1787. X          char    c;
  1788. X  
  1789. X--- 62,67 ----
  1790. X***************
  1791. X*** 106,114 ****
  1792. X      if (CoreDump)
  1793. X          abort();
  1794. X  #ifdef PROFILING
  1795. X!     exit(exp_p);
  1796. X  #else
  1797. X!     _exit(exp_p);
  1798. X  #endif
  1799. X  }
  1800. X  
  1801. X--- 102,110 ----
  1802. X      if (CoreDump)
  1803. X          abort();
  1804. X  #ifdef PROFILING
  1805. X!     exit(0);
  1806. X  #else
  1807. X!     _exit(0);
  1808. X  #endif
  1809. X  }
  1810. X  
  1811. X***************
  1812. X*** 137,143 ****
  1813. X      }
  1814. X      if (fcntl(fd, F_SETFL, on ? blockf : nonblockf) == -1)
  1815. X      finish(SIGHUP);
  1816. X-     return;
  1817. X  }
  1818. X  #endif SYSV
  1819. X  
  1820. X--- 133,138 ----
  1821. X***************
  1822. X*** 399,405 ****
  1823. X  }
  1824. X  
  1825. X  int    OKXonXoff = 0,        /* ^S and ^Q initially DON'T work */
  1826. X!     IntChar = CTL(]);
  1827. X  
  1828. X  ttsize()
  1829. X  {
  1830. X--- 394,400 ----
  1831. X  }
  1832. X  
  1833. X  int    OKXonXoff = 0,        /* ^S and ^Q initially DON'T work */
  1834. X!     IntChar = CTL(']');
  1835. X  
  1836. X  ttsize()
  1837. X  {
  1838. X***************
  1839. X*** 500,505 ****
  1840. X--- 495,502 ----
  1841. X      TABS = !((sg1.c_oflag & TAB3) == TAB3);
  1842. X      ospeed = sg1.c_cflag & CBAUD;
  1843. X  
  1844. X+     if (OKXonXoff)
  1845. X+         sg2.c_iflag &= ~(IXON | IXOFF);
  1846. X      sg2.c_iflag &= ~(INLCR|ICRNL|IGNCR);
  1847. X      sg2.c_lflag &= ~(ISIG|ICANON|ECHO);
  1848. X      sg2.c_oflag &= ~(OCRNL|ONLCR);
  1849. X***************
  1850. X*** 584,591 ****
  1851. X  
  1852. X      if (cp == 0) {
  1853. X          rbell();
  1854. X!         exp = 1;
  1855. X!         exp_p = errormsg = NO;
  1856. X          message(NullStr);
  1857. X      } else
  1858. X          ExecCmd(cp);
  1859. X--- 581,588 ----
  1860. X  
  1861. X      if (cp == 0) {
  1862. X          rbell();
  1863. X!         clr_arg_value();
  1864. X!         errormsg = NO;
  1865. X          message(NullStr);
  1866. X      } else
  1867. X          ExecCmd(cp);
  1868. X***************
  1869. X*** 662,668 ****
  1870. X  
  1871. X  dorecover()
  1872. X  {
  1873. X!     execl(Recover, "jove_recover", "-d", TmpFilePath, (char *)0);
  1874. X      printf("%s: execl failed!\n", Recover);
  1875. X      flusho();
  1876. X      _exit(-1);
  1877. X--- 659,665 ----
  1878. X  
  1879. X  dorecover()
  1880. X  {
  1881. X!     execl(Recover, "jove_recover", "-d", TmpFilePath, (char *) 0);
  1882. X      printf("%s: execl failed!\n", Recover);
  1883. X      flusho();
  1884. X      _exit(-1);
  1885. X***************
  1886. X*** 721,727 ****
  1887. X              case 't':
  1888. X                  ++argv;
  1889. X                  --argc;
  1890. X-                 exp_p = YES;
  1891. X                  find_tag(argv[1], YES);
  1892. X                  break;
  1893. X  
  1894. X--- 718,723 ----
  1895. X***************
  1896. X*** 812,818 ****
  1897. X      Mark    *m;
  1898. X  
  1899. X      sprintf(bname, "%s", curbuf->b_name);
  1900. X!     m = MakeMark(curline, curchar, FLOATER);
  1901. X  
  1902. X      RecDepth++;
  1903. X      UpdModLine++;
  1904. X--- 808,814 ----
  1905. X      Mark    *m;
  1906. X  
  1907. X      sprintf(bname, "%s", curbuf->b_name);
  1908. X!     m = MakeMark(curline, curchar, M_FLOATER);
  1909. X  
  1910. X      RecDepth++;
  1911. X      UpdModLine++;
  1912. X***************
  1913. X*** 820,826 ****
  1914. X      UpdModLine++;
  1915. X      RecDepth--;
  1916. X      SetBuf(do_select(curwind, bname));
  1917. X!     if (exp_p == NO)
  1918. X          ToMark(m);
  1919. X      DelMark(m);
  1920. X  }
  1921. X--- 816,822 ----
  1922. X      UpdModLine++;
  1923. X      RecDepth--;
  1924. X      SetBuf(do_select(curwind, bname));
  1925. X!     if (!is_an_arg())
  1926. X          ToMark(m);
  1927. X      DelMark(m);
  1928. X  }
  1929. X***************
  1930. X*** 846,858 ****
  1931. X          if (RecDepth == 0) {
  1932. X              if (ModMacs()) {
  1933. X                  rbell();
  1934. X!                 if (Upper(*ask("No",
  1935. X  "Some MACROS haven't been saved; leave anyway? ")) != 'Y')
  1936. X                      break;
  1937. X              }
  1938. X              if (ModBufs(0)) {
  1939. X                  rbell();
  1940. X!                 if (Upper(*ask("No",
  1941. X  "Some buffers haven't been saved; leave anyway? ")) != 'Y')
  1942. X                      break;
  1943. X              }
  1944. X--- 842,854 ----
  1945. X          if (RecDepth == 0) {
  1946. X              if (ModMacs()) {
  1947. X                  rbell();
  1948. X!                 if (CharUpcase(*ask("No",
  1949. X  "Some MACROS haven't been saved; leave anyway? ")) != 'Y')
  1950. X                      break;
  1951. X              }
  1952. X              if (ModBufs(0)) {
  1953. X                  rbell();
  1954. X!                 if (CharUpcase(*ask("No",
  1955. X  "Some buffers haven't been saved; leave anyway? ")) != 'Y')
  1956. X                      break;
  1957. X              }
  1958. X***************
  1959. X*** 880,887 ****
  1960. X  
  1961. X      for (;;) {
  1962. X          if (this_cmd != ARG_CMD) {
  1963. X!             exp = 1;
  1964. X!             exp_p = NO;
  1965. X              last_cmd = this_cmd;
  1966. X              init_strokes();
  1967. X          }
  1968. X--- 876,882 ----
  1969. X  
  1970. X      for (;;) {
  1971. X          if (this_cmd != ARG_CMD) {
  1972. X!             clr_arg_value();
  1973. X              last_cmd = this_cmd;
  1974. X              init_strokes();
  1975. X          }
  1976. X***************
  1977. X*** 1051,1061 ****
  1978. X      }
  1979. X      if (scanvec(argv, "-r"))
  1980. X          dorecover();
  1981. X  
  1982. X-     (void) time(&time0);
  1983. X      ttinit();    /* initialize terminal (after ~/.joverc) */
  1984. X      settout(ttbuf);    /* not until we know baudrate */
  1985. X-     ResetTerm();
  1986. X  
  1987. X      (void) signal(SIGHUP, finish);
  1988. X      (void) signal(SIGINT, finish);
  1989. X--- 1046,1056 ----
  1990. X      }
  1991. X      if (scanvec(argv, "-r"))
  1992. X          dorecover();
  1993. X+     if (scanvec(argv, "-rc"))
  1994. X+         FullRecover();
  1995. X  
  1996. X      ttinit();    /* initialize terminal (after ~/.joverc) */
  1997. X      settout(ttbuf);    /* not until we know baudrate */
  1998. X  
  1999. X      (void) signal(SIGHUP, finish);
  2000. X      (void) signal(SIGINT, finish);
  2001. X***************
  2002. X*** 1071,1078 ****
  2003. X  
  2004. X      /* set things up to update the modeline every UpdFreq seconds */
  2005. X      (void) signal(SIGALRM, updmode);
  2006. X!     (void) alarm((unsigned) UpdFreq);
  2007. X  
  2008. X      cl_scr(1);
  2009. X      flusho();
  2010. X      RedrawDisplay();    /* start the redisplay process. */
  2011. X--- 1066,1075 ----
  2012. X  
  2013. X      /* set things up to update the modeline every UpdFreq seconds */
  2014. X      (void) signal(SIGALRM, updmode);
  2015. X!     (void) time(&time0);
  2016. X!     (void) alarm((unsigned) (60 - (time0 % 60)));
  2017. X  
  2018. X+     ResetTerm();
  2019. X      cl_scr(1);
  2020. X      flusho();
  2021. X      RedrawDisplay();    /* start the redisplay process. */
  2022. END_OF_FILE
  2023. if test 43705 -ne `wc -c <'jove.pch.2'`; then
  2024.     echo shar: \"'jove.pch.2'\" unpacked with wrong size!
  2025. fi
  2026. # end of 'jove.pch.2'
  2027. fi
  2028. echo shar: End of archive 2 \(of 4\).
  2029. cp /dev/null ark2isdone
  2030. MISSING=""
  2031. for I in 1 2 3 4 ; do
  2032.     if test ! -f ark${I}isdone ; then
  2033.     MISSING="${MISSING} ${I}"
  2034.     fi
  2035. done
  2036. if test "${MISSING}" = "" ; then
  2037.     echo You have unpacked all 4 archives.
  2038.     rm -f ark[1-9]isdone
  2039. else
  2040.     echo You still need to unpack the following archives:
  2041.     echo "        " ${MISSING}
  2042. fi
  2043. ##  End of shell archive.
  2044. exit 0
  2045.